package nl.unimaas.micc.umsnooker.gameflow.phases;

import nl.unimaas.micc.umsnooker.gameflow.GamePhase;
import nl.unimaas.micc.umsnooker.gameflow.GameState;

public class PositioningPhase extends GamePhase
{

	public PositioningPhase(GameState state)
	{
		super(state);


	}

	@Override
	public void start()
	{
		super.start();
		state.getCueBall().setPosition(state.getTable().getBrownSpot().add(state.getTable().getDRadius()/2f, -state.getTable().getDRadius()/2f, 0));

	}

	public void setPosition(float x, float y)
	{
		state.getCueBall().getPosition().set(x, y, 0);
	}

	@Override
	public void finish()
	{
		if(finished)
		{
			return;
		}
		setNext(new AimingPhase(state));
		super.finish();
	}
}